System and method for copy on write on an ssd

ABSTRACT

Techniques for improved copy on write functionality within an SSD are disclosed. In some embodiments, the techniques may be realized as a method for providing improved copy on write functionality within an SSD including providing, in memory of a device, an indirection data structure. The data structure may include a master entry for cloned data, the master entry having a reference to one or more indexes and a clone entry for the cloned data, the cloned entry having at least one of: a reference to a master index, a reference to a next index, and a value indicating an end of a data structure. The techniques may include traversing, using a computer processor, one or more copies of the cloned data using one or more of the references.

BACKGROUND

The Non-Volatile Memory express (NVMe) Specification is a specificationfor accessing solid-state devices (SSDs) and other target devicesattached through a Peripheral Component Interconnect Express (PCIe) bus.The NVMe SSD PCIe host interface defines a concept of Namespaces, whichare analogous to logical volumes supported by SAS RAID (Redundant Arrayof Independent Disks) adapters. Copy on write functionality in an SSDmay be implemented using namespaces. Namespaces are typicallyimplemented as an abstraction above the global Logical Block Address(LBA) space tracked in an SSD's indirection system.

LBA metadata only indicates one host LBA and it does not include areference count. Including or appending a reference count in themetadata would incur additional writes to rewrite the data with newmetadata, which is a poor solution. Without such reference counts in theLBA metadata, there is not a mechanism for determining whetheradditional clone copies exist (e.g., that additional LBA's point to thesame data). Managing multiple clone copies of data on an SSD thereforefaces particular challenges with respect to garbage collection. Forexample, when a host modifies the ‘source’ LBA after a copy operation itmay produce garbage collection challenges. The source copy may beeffectively the ‘master’ copy that was written before the copy operationwas performed to duplicate the data to one or more additional host LBAs.When this master LBA is modified, a non-copy-aware garbage collectionalgorithm may free the physical data at the next opportunity, since amethod does not exist to efficiently modify that data's metadata toindicate that more host LBAs point to that data.

SUMMARY OF THE DISCLOSURE

Techniques for improved copy on write functionality within an SSD aredisclosed. In some embodiments, the techniques may be realized as amethod for providing improved copy on write functionality within an SSDincluding providing, in memory of a PCIe device, an indirection datastructure. The data structure may include a master entry for original orsource copy of the cloned data, the master entry having a reference to amaster index and a reference to a next index, a clone entry for thecloned data, the cloned entry having a reference to the master index anda reference to a next index. The techniques may include traversing,using a computer processor, one or more copies of the cloned data usingone or more of the references.

In accordance with additional aspects of this exemplary embodiment, thehost device may include at least one of: an enterprise server, adatabase server, a workstation, and a computer.

In accordance with additional aspects of this exemplary embodiment, theindirection data structure may include a plurality of physicaladdresses.

In accordance with further aspects of this exemplary embodiment, theindirection data structure may be part of a circularly linked list,wherein the master entry for cloned data comprises a reference to amaster index and a reference to a next index.

In accordance with other aspects of this exemplary embodiment, theindirection data structure may be part of a circularly linked list,wherein the clone entry for the cloned data comprises a reference to themaster index and a reference to a next index.

In accordance with additional aspects of this exemplary embodiment, theindirection data structure may be part of a single-ended linked list,wherein an entry in an index provides an indication that the index is amaster index.

In accordance with further aspects of this exemplary embodiment, thereferences may include entries in a flat indirection table for logicalblock addressing.

In accordance with other aspects of this exemplary embodiment, thereferences may include entries in a tree data structure for logicalblock addressing.

In accordance with additional aspects of this exemplary embodiment, theimproved copy on write functionality may include an improved namespacecopy functionality.

In accordance with further aspects of this exemplary embodiment, thetechniques may include setting an indicator for one or more packedlogical blocks to indicate that the one or more packed logical blocksare cloned.

In accordance with other aspects of this exemplary embodiment, a masterindex of the master entry may point to the master entry.

In accordance with additional aspects of this exemplary embodiment, themaster index of the cloned entry may point to the master entry.

In accordance with further aspects of this exemplary embodiment, thenext index of a last cloned entry in a data structure may point to themaster entry.

In accordance with other aspects of this exemplary embodiment, thetechniques may include determining that the clone entry for the cloneddata is an only clone entry, wherein the determination comprisesdetermining that the next index of the cloned entry matches the masterindex of the cloned entry, determining that the next index of the masterentry points to the clone entry, uncloning the clone entry of the cloneddata by setting the next index of the clone entry to a indirection entryindicating a packed logical block and setting the master index entry toa indirection entry indicating a packed logical block, and uncloning themaster entry of the cloned data by setting the next index of the masterentry to a first indirection entry indicating a first packed logicalblock of an original master entry and setting the master index of themaster entry to second indirection entry indicating second packedlogical block of the original master entry.

In accordance with additional aspects of this exemplary embodiment, thetechniques may include determining that the clone entry for the cloneddata is one of a plurality of clone entries, wherein the determinationcomprises determining at least one of: that the next index of the clonedentry does not match the master index of the cloned entry, and that thenext index of the master entry does not point to the clone entry, anduncloning the clone entry of the cloned data by setting the next indexof a prior entry to point to an entry indicated by the next index of theclone entry.

In accordance with further aspects of this exemplary embodiment, thetechniques may include reviewing an entry during a garbage collectionprocess, determining that the entry contains a cloned indicator, anddetermining that the entry in the garbage collection process is a validentry not to be deleted based upon the determination that the entrycontains the cloned indicator.

In other embodiments, the techniques may be realized as a computerprogram product comprised of a series of instructions executable on acomputer. The computer program product may perform a process forproviding improved copy on write functionality within an SSD. Thecomputer program may implement the steps of providing, in memory of adevice, an indirection data structure comprising a master entry forcloned data, the master entry having a reference to one or more indexes,a clone entry for the cloned data, the cloned entry having at least oneof: a reference to a master index, a reference to a next index, and avalue indicating an end of a data structure, and traversing, using acomputer processor, one or more copies of the cloned data using one ormore of the references.

In yet other embodiments, the techniques may be realized as a system forproviding improved copy on write functionality within an SSD. The systemmay include a first device, wherein the first device includes storedinstructions stored in memory. The instructions may include aninstruction to provide, in memory of the first device, an indirectiondata structure comprising a master entry for cloned data, the masterentry having a reference to one or more indexes, a clone entry for thecloned data, the cloned entry having at least one of: a reference to amaster index, a reference to a next index, and a value indicating an endof a data structure, and traversing, using a computer processor, one ormore copies of the cloned data using one or more of the references.

In accordance with additional aspects of this exemplary embodiment, theindirection data structure may include a plurality of physicaladdresses.

In accordance with further aspects of this exemplary embodiment, theindirection data structure may be part of a circularly linked list,wherein the master entry for cloned data comprises a reference to amaster index and a reference to a next index.

In accordance with other aspects of this exemplary embodiment, theindirection data structure may be part of a circularly linked list,wherein the clone entry for the cloned data comprises a reference to themaster index and a reference to a next index.

In accordance with additional aspects of this exemplary embodiment, theindirection data structure may be part of a single-ended linked list,wherein an entry in an index provides an indication that the index is amaster index.

In accordance with further aspects of this exemplary embodiment, thereferences may include entries in a flat indirection table for logicalblock addressing.

In accordance with other aspects of this exemplary embodiment, the firstdevice may include a Peripheral Component Interconnect Express (PCIe)device.

In accordance with additional aspects of this exemplary embodiment, thetechniques may further include an instruction to set an indicator forone or more packed logical blocks to indicate that the one or morepacked logical blocks are cloned.

In accordance with further aspects of this exemplary embodiment, themaster index of the master entry and the master index of the clonedentry may point to the master entry and the next index of a last clonedentry in a data structure points to the master entry.

In accordance with additional aspects of this exemplary embodiment, thetarget device (e.g., a PCIe device) may include at least one of: agraphics processing unit, an audio/video capture card, a hard disk, ahost bus adapter, and a Non-Volatile Memory express (NVMe) controller.According to some embodiments, the target device may be an NVMecompliant device.

The present disclosure will now be described in more detail withreference to exemplary embodiments thereof as shown in the accompanyingdrawings. While the present disclosure is described below with referenceto exemplary embodiments, it should be understood that the presentdisclosure is not limited thereto. Those of ordinary skill in the arthaving access to the teachings herein will recognize additionalimplementations, modifications, and embodiments, as well as other fieldsof use, which are within the scope of the present disclosure asdescribed herein, and with respect to which the present disclosure maybe of significant utility.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to facilitate a fuller understanding of the present disclosure,reference is now made to the accompanying drawings, in which likeelements are referenced with like numerals. These drawings should not beconstrued as limiting the present disclosure, but are intended to beexemplary only.

FIG. 1 shows an exemplary block diagram depicting a plurality of PCIedevices in communication with a host device, in accordance with anembodiment of the present disclosure.

FIG. 2 depicts a data structure representing uncloned packed logicalblocks, in accordance with an embodiment of the present disclosure.

FIG. 3 depicts tables representing master and clone indirection datastructure entries, in accordance with an embodiment of the presentdisclosure.

FIG. 4 depicts an exemplary module for improved copy on writefunctionality within an SSD, in accordance with an embodiment of thepresent disclosure.

FIG. 5 depicts a flowchart illustrating improved copy on writefunctionality within an SSD, in accordance with an embodiment of thepresent disclosure.

FIG. 6a depicts a data structure of Master C-Chunk data structure entryformats, in accordance with an embodiment of the present disclosure.

FIG. 6B depicts a data structure of Clone C-Chunk data structure entryformats, in accordance with an embodiment of the present disclosure.

DESCRIPTION

The present disclosure relates to improved copy on write functionality.In some embodiments, this copy on write functionality may includenamespace copies. The NVMe SSD PCIe host interface defines a concept ofNamespaces, which are analogous to logical volumes supported by SAS RAID(Redundant Array of Independent Disks) adapters. A namespace may bededicated to a Virtual Machine (VM). Within an SSD, Namespaces can belogically isolated from one another and can be securely erased andrepurposed without affecting other Namespaces.

A namespace identifier may be included in a media access command issuedby the host, along with the LBA within that namespace. The SSD may use adata structure (e.g., a table lookup, a tree, a hashmap, a bitmap, etc.)to translate that combination of namespace and LBA into a global LBAused internally to the SSD. According to some embodiments, references toan LBA may refer to this global LBA.

Embodiments of the present disclosure describe a system and method forimplementing an efficient Namespace Copy′ function that avoidsduplicating the data on the SSD. This reduces the write amplificationincurred within the SSD, which extends the life of the SSD whileproviding higher performance.

Namespace copies are a form of ‘copy on write’ functionality. On thecopy function, a pointer is generated that points to the single copy onthe media. A new copy on the media is generated and updated on a write.A Namespace copy function necessitates an efficient implementation of‘copy on write’ on an SSD. Embodiments of the present disclosure can beapplied to namespace copies. Embodiments of the present disclosure canalso be applied to other ‘copy on write’ implementations for an SSD. Forexample, a “snapshot” copy may be used to create point-in-time images ofa namespace and implementations of the present embodiment may be used totrack snapshot copies.

Embodiments of the present disclosure, provide an SSD indirection system(e.g. flat LBA table) or method to include multiple entries that pointto the same physical location. Such an implementation may enableefficient garbage collection when multiple references exist. Trackingmultiple references or handling multiple pointers (e.g., to NAND flashdata) may improve garbage collection. Garbage collection may beperformed using metadata on the non-volatile storage (e.g., NAND Flashmemory, NOR Flash memory, etc.) that includes the host LBA for the data.The garbage collection algorithm may determine which host sectors arestill valid by looking those LBAs up in the indirection data structure(e.g., a table, a tree, a hashmap, a bitmap, etc.) to see if the datastructure still points to the physical location. If not, the algorithmfrees the block.

One or more embodiments described herein provide efficientrepresentation of a duplicated indirection entry using a single flag andan alternate indirection entry format that tracks one or more duplicatedhost LBAs. One or more embodiments may use a flat indirection lookupdata structure for tracking multiple logical block addresses pointing toa same physical address. Other embodiments may be implemented using ahashmap, a tree, or composition-based system for tracking duplicatedLBAs.

Improved copy on write functionality within an SSD techniques arediscussed in further detail below.

Turning now to the drawings, FIG. 1 is an exemplary block diagramdepicting a PCIe device in communication with a host device, inaccordance with an embodiment of the present disclosure. Copy on writefunctionality improvements may be implemented in one or more computingtechnologies such as a host system 102, host CPU 104, and PCI expressroot complex 106. PCI express switch 108 may communicatively couple aplurality of targets (e.g., PCIe devices such as NVMe based targets)such as Targets 110, 116 and 122 to host system 102 via PCI express rootcomplex 106.

Target 110 may contain NVMe controller 112 and non-volatile storage 114.Target 116 may contain NVMe controller 118 and non-volatile storage 120.Target 122 may contain NVMe controller 124 and non-volatile storage 126.

System memory 128 may contain memory based resources accessible to HostSystem 102 via a memory interface (e.g., double data rate type threesynchronous dynamic random access memory (DDR3 SDRAM)). System memory128 can take any suitable form, such as, but not limited to, asolid-state memory (e.g., flash memory, or solid state device (SSD)),optical memory, and magnetic memory. System memory 128 can be volatileor non-volatile memory. System memory 128 may contain one or more datastructures.

According to some embodiments, interfaces standards other than PCIe maybe used for one or more portions including, but not limited to, SerialAdvanced Technology Attachment (SATA), Advanced Technology Attachment(ATA), Small Computer System Interface (SCSI), PCI-extended (PCI-X),Fibre Channel, Serial Attached SCSI (SAS), Secure Digital (SD), EmbeddedMulti-Media Card (EMMC), and Universal Flash Storage (UFS).

The host system 102 can take any suitable form, such as, but not limitedto, an enterprise server, a database host, a workstation, a personalcomputer, a mobile phone, a game device, a personal digital assistant(PDA), an email/text messaging device, a digital camera, a digital media(e.g., MP3) player, a GPS navigation device, and a TV system.

The host system 102 and the target device can include additionalcomponents, which are not shown in FIG. 1 to simplify the drawing. Also,in some embodiments, not all of the components shown are present.Further, the various controllers, blocks, and interfaces can beimplemented in any suitable fashion. For example, a controller can takethe form of one or more of a microprocessor or processor and acomputer-readable medium that stores computer-readable program code(e.g., software or firmware) executable by the (micro)processor, logicgates, switches, an application specific integrated circuit (ASIC), aprogrammable logic controller, and an embedded microcontroller, forexample.

Referring to FIG. 2, a data structure representing uncloned packedlogical blocks is illustrated, in accordance with an embodiment of thepresent disclosure. Eight, 4 kilobyte packed logical block entries areillustrated in this embodiment. These uncloned Packed Logical Blocks(PLBs) may map Logical Block Addresses (LBAs) to a physical address. Asdepicted LBAs 0-7 may be mapped to Physical Address Block 0, LBAs7-15may be mapped to Physical Address Block 1, LBAs 16-23 may be mapped toPhysical Address Block 2, LBAs 24-31 may be mapped to Physical AddressBlock 3, LBAs 32-39 may be mapped to Physical Address Block 4, LBAs40-47 may be mapped to Physical Address Block 5, LBAs 48-55 may bemapped to Physical Address Block 6, and LBAs 56-63 may be mapped toPhysical Address Block 7.

FIG. 3 depicts tables representing master and clone indirection datastructure entries, in accordance with an embodiment of the presentdisclosure. As described with reference to FIG. 3, in some embodiments,copy-on-write improvements may be implemented in a flat indirectionsystem. A PLB may be a “packed logical block” in a lookup data structure(e.g., a flat indirection lookup table). A set of 8 consecutive8-PLB-aligned PLBs involved in a cloning operation may be referred to asa “C-Chunk”. A C-Chunk whose data on the media is tagged with the PLBsappropriate for that C-Chunk (i.e. the original copy) may be called the“Master C-Chunk”. The indirection data structure entries for all PLBs ina C-Chunk may be grouped together to form a single “C-Entry”. A C-Entrycorresponding to a C-Chunk whose data resides on the media may be calleda Master C-Entry. C-Entries which describe LBA ranges that are copies ofthe Master LBA range may be referred to as Clone C-Entries. One or moreSSD's may define a PLB to track 4 KB of customer data plus metadata(e.g. 8×512 B sectors). In embodiments discussed below, a PLB may simplybe an entry in a table. An indirection data structure entry may beextended (e.g., by one bit) to facilitate copy-on-write. An extra bitmay be a “clone tracking” bit which may be set to 1 to indicate thateither there are other PLBs for which this PLB acts as the master copy,or this is a clone that has some other PLB as its master copy. Theremaining bits of the indirection data structure entry with the clonetracking bit set may or may not contain a NAND memory address (e.g.,like an entry without the bit set may). The alternate data structure for‘clone tracking=1’ is tracked at a coarser granularity than the typicalPLB entry, and includes fields to create a linked list of cloned entriesand a pointer to the master entry. Space for these additional fields maybe gained by using a single C-Entry to describe a larger (e.g. 2×) chunkof LBAs than an uncloned indirection entry. This tradeoff is reasonablebecause cloned data tends to involve large partitions or file sets andnot individual host LBAs.

The physical addresses of the individual host LBAs are distributed suchthat an additional lookup is required for some LBAs. This may make roomfor including the master and clone pointers in each master and cloneentry. The number of DRAM accesses to fetch the physical addresses isnot increased significantly, however. As illustrated in FIG. 3, theMaster C-Entry may contain LBAs mapped to all physical addresses 8-15,but only contains actual mappings to physical addresses 8-11, 14, and 15(the mapping to physical addresses 12 and 13 may be obtained from theClone C-Entry). As illustrated in the Clone C-Entry of FIG. 3, mappingsmay be provided for LBAs corresponding to physical addresses 8-13. Thetwo physical blocks not mapped in the Master C-entry (Physical Addresses12 and 13) provide space for a Master Index and a Next Index. The twophysical blocks not mapped in the Clone C-entry (Physical Addresses 14and 15) provide space for a Master Index and a Next Index. A MasterIndex in a Master C-Entry always points to itself. A Master Index in aClone C-entry always points to the Master C-Entry. A Next Index of theMaster C-Entry points to a first Clone C-Entry in a chain. A Next Indexof a Clone C-Entry points to a next Clone C-Entry if there is more thanone Clone C-entry. If there is only one Clone C-entry or it is the lastClone C-entry, the Next Index may point back to the Master C-index (orit may point to a special value indicating an end of the list such as,for example, a null pointer). This may allow traversal of a MasterC-Entry and one or more Clone C-entries.

In embodiments with a flat indirection data structure, a PLB (physicallocation block) refers to an individual entry containing a physical NANDmemory address in a single lookup table. A typical PLB granularitydedicates 4 KB (e.g. 8*512 B sectors) to a single data structure entry.As an example, consider a clone chunk size of 8 PLBs—the average numberof DRAM accesses required for purely random single sector accesses to acloned range is 1.25. This number can be lower with a larger clone chunksize, with a trade-off being less granular clone boundaries and moreNAND accesses required to ‘undone’ a chunk of PLBs.

If a host read PLB lookup points to a cloned entry, the SSD needs 1) thephysical address and 2) the LBA that was used when the data was written.The physical address is distributed between the master and cloneentries, optionally filling all available PLB entries with duplicatedata to reduce the probability that the targeted LBA requires a secondDRAM read. For #2, the master LBA can be calculated based on the masterpointer in each clone entry—this does not require an additional DRAMaccess by design, and this master pointer (along with the next clonepointer) may be cached from the original PLB lookup.

In some embodiments, in order to fit additional information in anexisting indirection data structure, cloning may be tracked only at agranularity that is some multiple of the PLB size. In some embodiments,the granularity may be chosen as a power-of-two multiple of the PLB sizein order to enable efficient computation of the index of the C-Chunkcorresponding to a given LBA. As an example, the multiplier may be 8,but larger cloning granularities may be used. Cloning may involvecloning large ranges of LBAs at a time (such as an entire namespace), sothe penalty for using a larger granularity may be minimal.

In some embodiments, the indirection data structure may have embedded init a circularly linked list of one or more C-Chunks that refer to thesame data. In other embodiments, other forms of linked lists (e.g., asingle-ended link list) may be used. The physical addresses describingthe C-Chunk's data may be spread among indirection entries for thatC-Chunk list.

A C-Chunk whose data resides physically on the media, tagged with thePLBs appropriate for that C-Chunk (i.e. the original copy) may be calledthe “Master C-Chunk”. Other C-Chunks that currently refer to the samedata without storing a copy on the media may be called “Clone C-Chunks”.

The indirection data structure entries for all PLBs in a C-Chunk aregrouped together to form a single “C-Entry”. For a Master C-Chunk, theC-Entry may be of the format illustrated in FIG. 6A. As illustrated, aMaster C-Chunk may contain physical addresses 0-3 (the first fourphysical addresses in a range), followed by physical addresses 6 and 7.The missing two physical addresses may be mapped in a Clone C-entry andthe two extra slots may be used to provide a master index and a nextindex. As illustrated, a “clone tracking” indicator may be set to 1.This may indicate to a garbage collection process that the C-entryshould be ignored.

For a Clone C-Chunk, the C-Entry may be of the format illustrated inFIG. 6B. As illustrated, physical addresses 0-5 may be mapped andphysical addresses 6 and 7 may be missing. The missing two physicaladdresses may be mapped in the Master C-entry and the two extra slotsmay be used to provide a master index and a next index. As illustrated,a “clone tracking” indicator may be set to 1. This may indicate to agarbage collection process that the G-entry should be ignored.

In one or more embodiments, NAND Address' may be the NAND address for ani^(th) PLB of the Master C-Chunk (with i=0 representing the first PLB).A Master Index may be an indirection data structure index of the MasterC-Entry (divided by 8 since it consumes the space of 8 PLB entries). ANext Index may be an indirection data structure index for the next CloneC-Entry pointing to the same data (divided by 8 since it consumes thespace of 8 PLB entries). If there are no more Clone C-Entries torepresent, this Next Index may point back to the Master C-Entry. In someembodiments, this Next Index may point to a value indicating terminationof the list (e.g., a null pointer).

In some embodiments, one or more tests may be used to determine whethera C-Chunk is a master entry. For example, a C-Chunk may be the master ifand only if the Master Index of its C-Entry points to the C-Entryitself.

The relationship between a Master C-Entry and a Clone C-Entry via MasterIndexes and Next Indexes may allow one or more of the followingoperations to be performed efficiently.

To clone a set of 8 consecutive 8-PLB-aligned PLBs one or more methodsmay be used. For example, in one or more embodiments, cloning a set ofPLBs may include:

-   -   1. Reading the 8 NAND Addresses for the PLBs of the original        copy to refer to when creating the Master and Clone C-Entries;    -   2. Creating a Master C-Entry in place of the indirection entries        of the 8 original PLBs. The Next Index may point to the new        Clone C-Entry; and    -   3. Creating a Clone C-Entry in place of the indirection entries        of the 8 PLBs that will now act as a clone. The Next Index may        point to the new Master C-Entry.

To clone a C-Chunk into a new C-Chunk one or more methods may be used.For example, in one or more embodiments, cloning a C-Chunk into a newC-Chunk may include:

-   -   1. If the source C-Chunk is a master, following a source        C-Entry's Next Index to find a clone C-Entry and copy it to the        location of the new C-Entry. If the source C-Chunk is not a        master, copying the source C-Entry to the location of the new        C-Entry;    -   2. Updating the Next Index of the new C-Entry with the Master        C-Entry's current Next Index;    -   3. Updating the Next Index of the Master C-Entry to point to the        new C-Entry.

To do a read lookup on a PLB whose indirection entry has Clone Trackingbit set, one or more methods may be used. For example, in one or moreembodiments, performing a read lookup on a PLB with an indirection bitset may include:

-   -   1. Looking at the C-Entry that contains this PLB's indirection        entry. Determining whether this C-Entry is a Master C-Entry or        not. Based on the determination, further determining whether the        NAND address for the desired Master PLB is stored in this        C-Entry.    -   2. If the NAND address is stored in the first C-Entry read, that        NAND address and the Master Index may be returned. The Master        Index can be used to determine what PLB number the data will be        tagged with, without performing any additional indirection        lookups.    -   3. If the NAND address is not stored in the first C-Entry read        and the first C-entry read is a master C-Entry, the Next Index        may be followed to find a Clone C-Entry that contains the NAND        address needed. That NAND address and the Master Index may be        returned.    -   4. If the NAND address is not stored in the C-Entry read and it        is a clone C-Entry, the Master Index may be followed to find a        Master C-Entry that contains the NAND address needed. That NAND        address and the Master Index may be returned.

To “undone” a Clone C-Chunk one or more techniques may be used. Forexample, in some embodiments the techniques may include:

-   -   1. Determining if there is only one clone. For example, if the        Next Index of the target's C-Entry matches its Master Index and        the Master C-Entry's Next Index points to the target C-Entry,        then there is only one clone. Read up the C-Entries for both the        Master and the Clone and overwrite the Master C-Entry with        “normal” indirection entries for those PLBs.    -   2. If the Next Index of the target's C-Entry does not match its        Master Index or the Master C-Entry's Next Index does not points        to the target C-Entry, then, there are other clones. Remove this        C-Entry from its circular list.    -   3. In either case, reading the data for the Master C-Chunk and        copying it to the Clone C-Chunk, overwriting the Clone C-Entries        with normal indirection entries indicating the NAND addresses of        the new copy.

To “undone” a Master C-Chunk one or more techniques may be used. Forexample, in some embodiments the techniques may include:

-   -   1. Reading the Master C-Entry and the first Clone C-Entry; and    -   2. Reading the data from a storage medium for the Master C-Chunk        and copying it to the PLB's of first Clone C-Chunk by writing it        to a new storage medium location and associating the host LBA        metadata with the corresponding Clone C-Chunk;    -   3. If that first clone is the sole clone (i.e. its Next Index        points back to the master), then overwriting the first Clone        C-Entry with normal indirection entries pointing to the NAND        addresses for the copy we just created. Overwrite the Master        C-Entry with normal indirection entries pointing to PLB's of the        original master C-Chunk    -   4. If the first clone was not the sole clone, remove the master        from the circularly linked list. Overwrite the first Clone        C-Entry with a new Master C-Entry for the copy we just created.        Overwrite other Clone C-Entries with a new Clone C-Entry for the        copy we just created. This may promote the first clone C-Entry        of the old Master C-Entry to become the new Master C-Entry for        itself and the remaining clone C-Entries.

When an indirection update is required for a target PLB that has theClone Tracking bit set, the techniques may include atomically:

-   -   1. Uncloning the PLB's C-Chunk; and    -   2. Performing the indirection update normally.

Garbage Collection may be implemented such that the garbage collectionalgorithm never discards the data for any physical data whose PLB ismarked with the Clone Tracking bit in the indirection system. That is,the garbage collection algorithm may consider all PLBs marked with aclone tracking bit to be “valid” data that requires relocation ratherthan erasure.

In one or more embodiments, a small counting bloom filter could bestored in SRAM to track C-Chunks present in the system. On a write, ifthe bloom filter may indicate there's no possibility of the PLB beingpart of a C-Chunk, then a direct update of the indirection system maysafely be performed without reading the current data structure entryfirst. Because clones tend to be large sequential ranges, the hashfunction used for a bloom filter may be something like: f(C-EntryIndex)=C-Entry Index/Filter Size rather than a random function.

FIG. 4 depicts an exemplary module for improved copy on writefunctionality within an SSD, in accordance with an embodiment of thepresent disclosure. As illustrated in FIG. 4, copy on write module 410may contain indirection creation module 412, indirection managementmodule 414, and error handling module 416.

Indirection creation module 412 may create one or more data structuresfor tracking copy on write copies. A PLB may simply be an entry in atable. An indirection data structure entry may be extended (e.g., by onebit) to facilitate copy-on-write. An extra bit may be a “clone tracking”bit which may be set to 1 to indicate that either there are other PLBsfor which this PLB acts as the master copy, or this is a clone that hassome other PLB as its master copy. The remaining bits of the indirectiondata structure entry with the clone tracking bit set may or may notcontain a NAND address (e.g., like an entry without the bit set may).The alternate data structure for ‘clone tracking=l’ includes fields tocreate a linked list of cloned entries and a pointer to the masterentry. Space for these additional fields is gained by using a singleentry to describe a larger (e.g. 2×) chunk of LBAs than an unclonedindirection entry.

Indirection management module 414 may perform one or more operationsusing an indirection data structure. Indirection management module 414may facilitate cloning of data, reading of cloned data, uncloning data,and facilitate safe and efficient garbage collection using one or moreof the methods as discussed above in reference to FIG. 3.

Error handling module 416 may trap, log, report, and/or handle one ormore errors associated with managing cloned data.

FIG. 5 depicts a flowchart illustrating improved copy on writefunctionality within an SSD, in accordance with an embodiment of thepresent disclosure. The process 500, however, is exemplary only. Theprocess 500 can be altered, e.g., by having stages added, changed,removed, or rearranged. At stage 502, the process may begin.

At stage 504, a master c-entry may be created. A C-Chunk whose dataresides physically on the media, tagged with the PLBs appropriate forthat C-Chunk (i.e. the original copy) may be called the “MasterC-Chunk”. Other C-Chunks that currently refer to the same data withoutstoring a copy on the media may be called “Clone C-Chunks”.

The indirection data structure entries for all PLBs in a C-Chunk aregrouped together to form a single “C-Entry”. For a Master C-Chunk, theC-Entry may be of the format illustrated in FIG. 6A.

At stage 506, a clone c-entry may be created. For a Clone C-Chunk, theC-Entry may be of the format illustrated in FIG. 6B.

In one or more embodiments, NAND Address' may be the NAND address for ani^(th) PLB of the Master C-Chunk (with i=0 representing the first PLB).

At stage 508, a block may be assigned to indicate a master index. AMaster Index may be an indirection data structure index of the MasterC-Entry (divided by 8 since it consumes the space of 8 PLB entries).Master Indexes of both a Master C-Entry and a Clone C-Entry may point toa Master C-Entry.

At stage 510, a block may be assigned to indicate a next index. A NextIndex may be an indirection data structure index for the next CloneC-Entry pointing to the same data (divided by 8 since it consumes thespace of 8 PLB entries). If there are no more Clone C-Entries torepresent, this Next Index may point back to the Master C-Entry.

In some embodiments, one or more tests may be used to determine whethera C-Chunk is a master entry. For example, a C-Chunk may be the master ifand only if the Master Index of its C-Entry points to the C-Entryitself.

At stage 512, the method 500 may end.

Other embodiments are within the scope and spirit of the invention. Forexample, the functionality described above can be implemented usingsoftware, hardware, firmware, hardwiring, or combinations of any ofthese. One or more computer processors operating in accordance withinstructions may implement the functions associated with improved copyon write functionality within an SSD in accordance with the presentdisclosure as described above. If such is the case, it is within thescope of the present disclosure that such instructions may be stored onone or more non-transitory processor readable storage media (e.g., amagnetic disk or other storage medium). Additionally, modulesimplementing functions may also be physically located at variouspositions, including being distributed such that portions of functionsare implemented at different physical locations.

The present disclosure is not to be limited in scope by the specificembodiments described herein. Indeed, other various embodiments of andmodifications to the present disclosure, in addition to those describedherein, will be apparent to those of ordinary skill in the art from theforegoing description and accompanying drawings. Thus, such otherembodiments and modifications are intended to fall within the scope ofthe present disclosure. Further, although the present disclosure hasbeen described herein in the context of a particular implementation in aparticular environment for a particular purpose, those of ordinary skillin the art will recognize that its usefulness is not limited thereto andthat the present disclosure may be beneficially implemented in anynumber of environments for any number of purposes. Accordingly, theclaims set forth below should be construed in view of the full breadthand spirit of the present disclosure as described herein.

What is claimed is:
 1. A method for providing improved copy on writefunctionality within an SSD comprising: providing, in memory of adevice, an indirection data structure comprising: a master entry forcloned data, the master entry having a reference to one or more indexes;a clone entry for the cloned data, the cloned entry having at least oneof: a reference to a master index, a reference to a next index, and avalue indicating an end of a data structure; and traversing, using acomputer processor, one or more copies of the cloned data using one ormore of the references.
 2. The method of claim 1, wherein theindirection data structure comprises a plurality of physical addresses.3. The method of claim 1, wherein the indirection data structure is partof a circularly linked list, wherein the master entry for cloned datacomprises a reference to a master index and a reference to a next index.4. The method of claim 1, wherein the indirection data structure is partof a circularly linked list, wherein the clone entry for the cloned datacomprises a reference to the master index and a reference to a nextindex.
 5. The method of claim 1, wherein the indirection data structureis part of a single-ended linked list, wherein an entry in an indexprovides an indication that the index is a master index.
 6. The methodof claim 1, wherein the references comprise entries in a flatindirection table for logical block addressing.
 7. The method of claim1, wherein the references comprise entries in a tree data structure forlogical block addressing.
 8. The method of claim 1, wherein the improvedcopy on write functionality comprises an improved namespace copyfunctionality.
 9. The method of claim 1, further comprising setting anindicator for one or more packed logical blocks to indicate that the oneor more packed logical blocks are cloned.
 10. The method of claim 1,wherein a master index of the master entry points to the master entry.11. The method of claim 3, wherein the master index of the cloned entrypoints to the master entry.
 12. The method of claim 4, wherein the nextindex of a last cloned entry in a data structure points to the masterentry.
 13. The method of claim 4, further comprising: determining thatthe clone entry for the cloned data is an only clone entry, wherein thedetermination comprises: determining that the next index of the clonedentry matches the master index of the cloned entry; determining that thenext index of the master entry points to the clone entry; uncloning theclone entry of the cloned data by setting the next index of the cloneentry to a indirection entry indicating a packed logical block andsetting the master index entry to a indirection entry indicating apacked logical block; and uncloning the master entry of the cloned databy setting the next index of the master entry to a first indirectionentry indicating a first packed logical block of an original masterentry and setting the master index of the master entry to secondindirection entry indicating second packed logical block of the originalmaster entry.
 14. The method of claim 4, further comprising: determiningthat the clone entry for the cloned data is one of a plurality of cloneentries, wherein the determination comprises determining at least oneof: that the next index of the cloned entry does not match the masterindex of the cloned entry; and that the next index of the master entrydoes not point to the clone entry; and uncloning the clone entry of thecloned data by setting the next index of a prior entry to point to anentry indicated by the next index of the clone entry.
 15. The method ofclaim 1, further comprising: reviewing an entry during a garbagecollection process; determining that the entry contains a clonedindicator; and determining that the entry in the garbage collectionprocess is a valid entry not to be deleted based upon the determinationthat the entry contains the cloned indicator.
 16. A computer programproduct comprised of a series of instructions executable on a computer,the computer program product performing a process for providing improvedcopy on write functionality within an SSD; the computer programimplementing the steps of: providing, in memory of a device, anindirection data structure comprising: a master entry for cloned data,the master entry having a reference to one or more indexes; a cloneentry for the cloned data, the cloned entry having at least one of: areference to a master index, a reference to a next index, and a valueindicating an end of a data structure; and traversing, using a computerprocessor, one or more copies of the cloned data using one or more ofthe references.
 17. A system for providing improved copy on writefunctionality within an SSD, the system comprising: a first device;wherein the first device includes stored instructions stored in memory,the instructions comprising: an instruction to provide, in memory of thefirst device, an indirection data structure comprising: a master entryfor cloned data, the master entry having a reference to one or moreindexes; a clone entry for the cloned data, the cloned entry having atleast one of: a reference to a master index, a reference to a nextindex, and a value indicating an end of a data structure; andtraversing, using a computer processor, one or more copies of the cloneddata using one or more of the references.
 18. The system of claim 17,the indirection data structure comprises a plurality of physicaladdresses.
 19. The system of claim 17, wherein the indirection datastructure is part of a circularly linked list, wherein the master entryfor cloned data comprises a reference to a master index and a referenceto a next index.
 20. The system of claim 17, wherein the indirectiondata structure is part of a circularly linked list, wherein the cloneentry for the cloned data comprises a reference to the master index anda reference to a next index.
 21. The system of claim 17, wherein theindirection data structure is part of a single-ended linked list,wherein an entry in an index provides an indication that the index is amaster index.
 22. The system of claim 17, wherein the referencescomprise entries in a flat indirection table for logical blockaddressing.
 23. The system of claim 17, wherein the first devicecomprises a Peripheral Component Interconnect Express (PCIe) device. 24.The system of claim 17, further comprising an instruction to set anindicator for one or more packed logical blocks to indicate that the oneor more packed logical blocks are cloned.
 25. The system of claim 20,wherein the master index of the master entry and the master index of thecloned entry point to the master entry and the next index of a lastcloned entry in a data structure points to the master entry.